Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolves #216 Inconsistent Mark as Complete, checkboxes and Percentage of Video Completed #252

Closed
wants to merge 1 commit into from

Conversation

Maawan
Copy link
Contributor

@Maawan Maawan commented Mar 20, 2024

#216
Hi @hkirat
My Approach to solve this issue

I have created an atom, which will be storing the completed status of all the contents present in the course. It will be in this form
[
{id : 2 ,
parentId : 1,
isCompleted : false},
{
id : 3,
parentId : 1,
isCompleted : true
}]

I can't use server function in client side so I can't use selectors here to fetch the data. So, I am initialising this atoms value using SideBar Component, whenever Sidebar is mounted, it will initialise the atom's value.

The Percentage completed shown on the folders is also handled, specifically parentId is used to calculate all children and the children which have completed the video. In this way I have tacked the percentage state also

In the ContentRendererClient where markAsComplete was written, I have shifted it to a new component just to avoid Re-renders of the video player otherwise, video was flickering was state was changing.

Untitled.video.-.Made.with.Clipchamp.2.mp4

This is a collaborative effort of me and @devsargam

@Maawan Maawan closed this Mar 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant